//
//  BaseCollectionView.h
//  BasicProject
//
//  Created by 马军凯 on 2023/4/13.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface BaseCollectionView : UICollectionView
//几组
@property (nonatomic, assign) NSInteger sections;
//每组个数
@property (nonatomic, retain) NSArray<NSNumber *> *rows;
//创建Cell
@property (nonatomic, copy) UICollectionViewCell *(^CreateCell)(NSIndexPath *indexPath);
//cell的尺寸
@property (nonatomic, copy) CGSize (^CellSize)(NSIndexPath *indexPath);
//cell的点击
@property (nonatomic, copy) void(^SelectedCell)(NSIndexPath *indexPath);

//行与行之间的间距
@property (nonatomic, copy) CGFloat (^RowMargin)(NSInteger section);
//列与列之间的间距
@property (nonatomic, copy) CGFloat (^ColumnMargin)(NSInteger section);
//内边距 上下左右的距离
@property (nonatomic, copy) UIEdgeInsets (^ItemPadding)(NSInteger section);

//头
@property (nonatomic, copy) UICollectionReusableView *(^CreateHeader)(NSIndexPath *indexPath);
//头尺寸
@property (nonatomic, copy) CGSize (^HeaderHeight)(NSInteger section);

//尾
@property (nonatomic, copy) UICollectionReusableView *(^CreateFooter)(NSIndexPath *indexPath);
//尾尺寸
@property (nonatomic, copy) CGSize (^FooterHeight)(NSInteger section);

//初始化
//简单版本
- (instancetype)initWithFrame:(CGRect)frame
                    direction:(UICollectionViewScrollDirection)direction
                     itemSize:(CGSize)itemSize
                    rowMargin:(CGFloat)rowMargin
                 columnMargin:(CGFloat)columnMargin
                 sectionInset:(UIEdgeInsets)sectionInset;
//复杂版本 需要各种尺寸布局的 eg:每个section尺寸不一样 间距不一样等
- (instancetype)initWithFrame:(CGRect)frame direction:(UICollectionViewScrollDirection)direction;



//MARK: ↓↓↓↓↓↓↓↓↓↓瀑布流的方法和变量 *****必须设置的*****↓↓↓↓↓↓↓↓↓↓
//几列
@property (nonatomic, assign) NSInteger columnCount;
//高度的数组
@property (nonatomic, retain) NSArray <NSArray <NSNumber *> *> *cellHeightArray;
//初始化
- (instancetype)initAutoLayoutWithFrame:(CGRect)frame;
//MARK: ↑↑↑↑↑↑↑↑↑↑瀑布流的方法和变量↑↑↑↑↑↑↑↑↑↑

@end

NS_ASSUME_NONNULL_END
